<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<form action="#" method="post" onsubmit="return ">
    <p>
        <span>
            用户名:
        </span><input type="text" id="username">
    </p>
    <p>
        <span>
            性别:
        </span>
        <input type="radio" name="sex" value="man" id="boy">男
        <input type ="radio" name ="sex" value="women" id="girl">女
    </p>
</form>

<script>
    var input_text=document.getElementById("username");
    var boyradio=document.getElementById("boy");
    boyradio.checked;
    input_text;
</script>
</body>
</html>